package day4;

public class Oblong {
	private int width;
	private int hight;
	private String name;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getWidth() {
		return width;
	}
	public void setWidth(int width) {
		this.width = width;
	}
	public int getHight() {
		return hight;
	}
	public void setHight(int hight) {
		this.hight = hight;
	}
	
	public Oblong() {
		this.width = 1;
		this.hight = 1;
	}
	public Oblong(int width) {
		this.width = width;
		this.hight = width;
	}
	public Oblong(int width, int hight) {
		this.width = width;
		this.hight = hight;
	}
	public void girth() {
		System.out.println(name + "的周长为：" + (2 * (width + hight)));
	}
	public void area() {
		System.out.println(name + "的面积为：" + width * hight);
	}
}
